import 'package:flutter_test/flutter_test.dart';
import 'package:my_flutter_webview_core/my_flutter_webview_core.dart';
import 'package:my_flutter_webview_core/my_flutter_webview_core_platform_interface.dart';
import 'package:my_flutter_webview_core/my_flutter_webview_core_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockMyFlutterWebviewCorePlatform
    with MockPlatformInterfaceMixin
    implements MyFlutterWebviewCorePlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final MyFlutterWebviewCorePlatform initialPlatform = MyFlutterWebviewCorePlatform.instance;

  test('$MethodChannelMyFlutterWebviewCore is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelMyFlutterWebviewCore>());
  });

  test('getPlatformVersion', () async {
    MyFlutterWebviewCore myFlutterWebviewCorePlugin = MyFlutterWebviewCore();
    MockMyFlutterWebviewCorePlatform fakePlatform = MockMyFlutterWebviewCorePlatform();
    MyFlutterWebviewCorePlatform.instance = fakePlatform;

    expect(await myFlutterWebviewCorePlugin.getPlatformVersion(), '42');
  });
}
